<?xml version="1.0" encoding="UTF-8"?>
<p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-req.xsd ">
    <GetQuote>
        <Request>
            <ServiceHeader>
                <SiteID><%= @site_id %></SiteID>
                <Password><%= @password %></Password>
            </ServiceHeader>
        </Request>
        <From>
            <CountryCode><%= @from_country_code %></CountryCode>
            <Postalcode><%= @from_postal_code %></Postalcode>
            <% if @from_city_name -%><City><%= @from_city_name %></City><% end -%>
        </From>
        <BkgDetails>
            <PaymentCountryCode><%= @from_country_code %></PaymentCountryCode>
            <Date><%= ready_date %></Date>
            <ReadyTime><%= ready_time %></ReadyTime>
            <ReadyTimeGMTOffset>+00:00</ReadyTimeGMTOffset>
            <DimensionUnit><%= dimensions_unit %></DimensionUnit>
            <WeightUnit><%= weight_unit %></WeightUnit>
            <Pieces>
                <% pieces.each_with_index do |piece,i| %><%= piece.piece_id = i+1; piece.to_xml %><% end %>
            </Pieces>
            <% if @payment_account_number -%>
                <PaymentAccountNumber><%= @payment_account_number %></PaymentAccountNumber>
            <% end -%>
            <IsDutiable><%= dutiable? ? "Y" : "N" %></IsDutiable>
            <% if special_services.size>0 -%>
                <QtdShp>
                    <% special_services.each do |special_service_type_code| -%>
                        <QtdShpExChrg>
                            <SpecialServiceType><%= special_service_type_code %></SpecialServiceType>
                        </QtdShpExChrg>
                     <% end -%>
                </QtdShp>
            <% end -%>
        </BkgDetails>
        <To>
            <CountryCode><%= @to_country_code %></CountryCode>
            <Postalcode><%= @to_postal_code %></Postalcode>
            <% if @to_city_name -%><City><%= @to_city_name %></City><% end -%>
        </To>
        <%- if dutiable? %>
            <Dutiable>
                <DeclaredCurrency><%= @duty[:declared_currency] %></DeclaredCurrency>
                <DeclaredValue><%= @duty[:declared_value] %></DeclaredValue>
            </Dutiable>
        <% end %>
    </GetQuote>
</p:DCTRequest>
